package applicationServer;

import applicationServer.configurationManagement.ConfigurationManager;
import applicationServer.connection.ConnectionManager;
import applicationServer.logic.ClientManager;

/**
 * Initial calls for creating and managing the mediaServer.
 * Containts the testing functions and the evaluation processes for the creation of the instances for the media management
 * @version 0.1 (Development-Early Alpha)
 * @author Gonzalo Canelada Purcell
 * @date 28 September 2009
 */
public class InitiateAS {

	/**
	 * Handles the configuration information stored in the local file
	 */
	private ConfigurationManager configM = null;
	/**
	 * Handles the communications between the ApplicationServer and the clients
	 */
	private ConnectionManager connM = null;
	
	private ClientManager clientM = null;
	
	public InitiateAS() {
		System.out.println("hello");
		configM = createConfigurationManager();
		clientM = createClientManager();
		connM = createConnectionmanager(configM,clientM);
	}
	
	private ConfigurationManager createConfigurationManager(){
		return  new ConfigurationManager();
	}

	private ConnectionManager createConnectionmanager(ConfigurationManager _configM, ClientManager clientm){
		return new ConnectionManager(_configM.get_config(),clientm);
	}
	
	
	private ClientManager createClientManager(){
		ClientManager c =  new ClientManager();
		c.loadServers(configM);
		return c;
	}
	
	public static void main(String[] args) {
		new InitiateAS();
	}
	
}
